From c1ba885db29b69465e1b807bd95357bafebf8a43 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 17 Feb 2011 22:36:11 +0000 Subject: [PATCH] Fix a bug in string recognition in JSDistiller. This *really* fixes bug 27481 --- includes/libs/JavaScriptDistiller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/libs/JavaScriptDistiller.php b/includes/libs/JavaScriptDistiller.php index a5aae1e5ca..15650cdb07 100644 --- a/includes/libs/JavaScriptDistiller.php +++ b/includes/libs/JavaScriptDistiller.php @@ -77,8 +77,8 @@ class JavaScriptDistiller { // Protect strings. The original code had [^\'\\v] here, but that didn't armor multiline // strings correctly. This also armors multiline strings that don't have backslashes at the // end of the line (these are invalid), but that's fine because we're just armoring here. - $parser->add( '/\'([^\'\\\\]*(\\\\.[^\'\\\\]*)*)\'/', '$1' ); - $parser->add( '/"([^"\\\\]*(\\\\.[^"\\\\]*)*)"/', '$1' ); + $parser->add( '/\'([^\'\\\\]*(\\\\(.|[\r\n])[^\'\\\\]*)*)\'/', '$1' ); + $parser->add( '/"([^"\\\\]*(\\\\(.|[\r\n])[^"\\\\]*)*)"/', '$1' ); // Protect regular expressions $parser->add( '/[ \\t]+((\\/[^\\r\\n\\*][^\\/\\r\\n\\\\]*(\\\\.[^\\/\\r\\n\\\\]*)*\\/(i|g)*))/', '$1' ); $parser->add( '/([^\\w\\$\\/\'"*)\\?:](\\/[^\\r\\n\\*][^\\/\\r\\n\\\\]*(\\\\.[^\\/\\r\\n\\\\]*)*\\/(i|g)*))/', '$1' ); -- 2.20.1